﻿using EquipmentModule.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace EquipmentModule.Contracts
{
    public interface IEquipmentService
    {
        /// <summary>
        /// 查询设备
        /// </summary>
        /// <param name="id"></param>
        /// <param name="sassId"></param>
        /// <param name="dbStr"></param>
        /// <param name="name"></param>
        /// <param name="db"></param>
        /// <returns></returns>
        IEnumerable<Equipment> Index(Guid? id, Guid? sassId, string dbStr = null, string name = null, string db = null);
        /// <summary>
        /// 添加设备
        /// </summary>
        /// <param name="info"></param>
        /// <param name="dbStr"></param>
        void Add(Equipment info, string dbStr = null);
        
        /// <summary>
        /// 更新设备
        /// </summary>
        /// <param name="info"></param>
        /// <param name="dbStr"></param>
        void Update(Equipment info, string dbStr = null);
        
        /// <summary>
        /// 删除设备
        /// </summary>
        /// <param name="id"></param>
        /// <param name="dbStr"></param>
        void Del(Guid id, string dbStr = null);
        /// <summary>
        /// 设备下拉框DevId，
        /// </summary>
        /// <param name="dbStr"></param>
        /// <returns></returns>
        IEnumerable<DownListInfo> DownList(string dbStr = null);
        /// <summary>
        /// 分享设备
        /// </summary>
        /// <param name="datas"></param>
        void ShareEquipment(EquipmentSassInfo info);

        /// <summary>
        /// 根据ProjectId获取列表
        /// </summary>
        /// <param name="ProjectId"></param>
        /// <returns></returns>
        IEnumerable<Equipment> QueryByProjectId(String ProjectId);

        /// <summary>
        /// 根据设备类型 获取所有设备
        /// </summary>
        /// <param name="machineType"></param>
        /// <returns></returns>
        IEnumerable<Equipment> QueryByMachineType(String machineType);
    }
}
